﻿<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>User Timing</title>
<style type="text/css">
   pre.idl { border:solid thin; background:#eee; color:#000; padding:0.5em }
   pre.idl :link, pre.idl :visited { color:inherit; background:transparent }
   pre code { color:inherit; background:transparent }
   div.example { margin-left:1em; padding-left:1em; border-left:double; color:#222; background:#fcfcfc }
   .note { margin-left:2em; font-weight:bold; font-style:italic; color:#008000 }
   p.note::before { content:"Note: " }
   .XXX { padding:.5em; border:solid #f00 }
   p.XXX::before { content:"Issue: " }
   dl.switch { padding-left:2em }
   dl.switch > dt { text-indent:-1.5em }
   dl.switch > dt:before { content:'\21AA'; padding:0 0.5em 0 0; display:inline-block; width:1em; text-align:right; line-height:0.5em }
   dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
   dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
   dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
   dl.domintro dd p { margin: 0.5em 0; }
   dl.domintro:before { display: table; margin: -1em -0.5em -0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: red; border: solid 2px; background: white; padding: 0 0.25em; }
   em.ct { text-transform:lowercase; font-variant:small-caps; font-style:normal }
   dfn { font-weight:bold; font-style:normal }
   code { color:orangered }
   code :link, code :visited { color:inherit }
   hr:not(.top) { display:block; background:none; border:none; padding:0; margin:2em 0; height:auto }
   table { border-collapse:collapse; border-style:hidden hidden none hidden }
   table thead { border-bottom:solid }
   table tbody th:first-child { border-left:solid }
   table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
   div.parameters { display:block; margin-left: 25px;}
   div.parameterDefinition { display:block; margin-left: 25px;}
   div.methods { display:block; margin-top:30px; margin-left :25px;}
</style>
<link href="https://www.w3.org/StyleSheets/TR/W3C-ED.css" rel="stylesheet" type="text/css">
</head>

<body class="draft">
<div class="head">
    <h1>User Timing</h1>
    <h2 class="no-num no-toc" id="editors-draft-july-11-2012">Editor's Draft July 11, 2012</h2>
    <dl>
      <dt>This version:</dt>
        <dd><a href="http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/UserTiming/Overview.html">
        http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/UserTiming/Overview.html</a></dd>
      <dt>Latest version:</dt>
		<dd><a href="http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/UserTiming/Overview.html">
        http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/UserTiming/Overview.html</a></dd>
      <dt>Editors:</dt>
        <dd class="vcard">
            <span class="fn">Jatinder Mann</span>, <span class="org">Microsoft Corp.</span>,
            <span class="email">jmann@microsoft.com</span>
        </dd>
        <dd class="vcard">
            <span class="fn">Zhiheng Wang</span>, <span class="org">Google Inc.</span>
            <i>(Until July 2013)</i>
        </dd>
        <dd class="vcard">
            <span class="fn">Anderson Quach</span>,
            <span class="org">Microsoft Corp.</span> <i>(Until March 2011)</i>
        </dd>
    </dl>

    <p class=copyright><a
    href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
    &copy; 2012 <a href="http://www.w3.org/"><abbr title="World Wide Web
    Consortium">W3C</abbr></a><sup>&reg;</sup> (<a
    href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute
    of Technology">MIT</abbr></a>, <a
    href="http://www.ercim.eu/"><abbr title="European Research Consortium
    for Informatics and Mathematics">ERCIM</abbr></a>, <a
    href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
    href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
    <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
    and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
    rules apply.</p>

    <hr class='top'>

</div>
<div class='body'>

    <h2 class="no-num no-toc" id="abstract">Abstract</h2>

    <p>This specification defines an interface to help web
    developers measure the performance of their applications by giving them access
    to high precision timestamps.</p>

    <h2 class="no-num no-toc" id="status-of-this-document">Status of this document</h2>

  <p><em>This section describes the status of this document at the time of
   its publication. Other documents may supersede this document. A list of
   current W3C publications and the latest revision of this technical report
   can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
   index</a> at http://www.w3.org/TR/.</em></p>

<p>This is a <strong>work in progress</strong> and may change without any
notices. </p>

<p>Please send comments
   to <a href="mailto:public-web-perf@w3.org?subject=%5BUserTiming%5D%20">public-web-perf@w3.org</a>
   (<a href="http://lists.w3.org/Archives/Public/public-web-perf/">archived</a>)
   with <samp>[UserTiming]</samp> at the start of the subject line.</p>

<p>This document is produced by
   the <a href="http://www.w3.org/2010/webperf/">Web Performance</a>
   Working Group. The Web Performance Working Group is part of
   the <a href="http://www.w3.org/2006/rwc/Activity">Rich Web Clients
   Activity</a> in the
   W3C <a href="http://www.w3.org/Interaction/">Interaction
   Domain</a>.

<p>Publication as a Working Draft does not imply endorsement by the
W3C Membership. This is a draft document and may be updated, replaced
or obsoleted by other documents at any time. It is inappropriate to
cite this document as other than work in progress. </p>

<p>This document was produced by a group operating under
   the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
   February 2004 W3C Patent Policy</a>. W3C maintains
   a <a href="http://www.w3.org/2004/01/pp-impl/45211/status"
   rel="disclosure">public list of any patent disclosures</a> made in
   connection with the deliverables of the group; that page also
   includes instructions for disclosing a patent. An individual who
   has actual knowledge of a patent which the individual believes
   contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
   Claim(s)</a> must disclose the information in accordance
   with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
   6 of the W3C Patent Policy</a>.</p>

    <h2 class="no-num no-toc" id="table-of-contents">Table of Contents</h2>
    <ol class="toc">
      <li><a href="#introduction"><span class="secno">1
      </span>Introduction</a></li>
      <li><a href="#conformance-requirements"><span class="secno">2
        </span>Conformance requirements</a></li>
      <li><a href="#terminology"><span class="secno">3 </span>Terminology</a></li>
      <li><a href="#user-timing-0"><span class="secno">4 </span>User Timing</a>
        <ol class="toc">
          <li><a href="#introduction-1"><span class="secno">4.1</span> Introduction</a></li>
          <li><a href="#extensions-performance-interface"><span class="secno">4.2</span> Extensions to the <code>Performance</code> Interface</a></li>
          <li><a href="#performancemark"><span class="secno">4.3</span> The <code>PerformanceMark</code> Interface</a></li>
          <li><a href="#performancemeasure"><span class="secno">4.4</span> The <code>PerformanceMeasure</code> Interface</a></li>
          <li><a href="#vendor-prefixes"><span class="secno">4.5</span> Vendor Prefixes</a></li>
        </ol>
      </li>
      <li><a href="#monotonic-clock"><span class="secno">5 </span>Monotonic Clock</a></li>
	  <li><a href="#privacy-security"><span class="secno">6 </span>Privacy and Security</a></li>
      <li><a class="no-num" href="#acknowledgements">Acknowledgements</a></li>
      <li><a class="no-num" href="#references">References</a></li>
    </ol>

    <h2 id="introduction"><span class="secno">1 </span>Introduction</h2>

    <p>This section is non-normative.</p>
    <p>Web developers need the ability to assess and understand the performance characteristics of their
    applications. While JavaScript <a href='#ECMA262'>[ECMA262]</a> provides a mechanism to measure application latency (retrieving the current
    timestamp from the <code>Date.now()</code> method), the precision of this timestamp varies between user agents.</p>
    <p>This document defines the <a href="#performancemark"><code>PerformanceMark</code></a> and 
	<a href="#performancemeasure"><code>PerformanceMeasure</code></a> interfaces, and extensions to the
	<a href="#extensions-performance-interface"><code>Performance</code></a> interface,	
    which expose a high precision timestamp to developers so they can better measure the performance of their applications.</p>
    
    <div class="example">
    <p>The following script shows how a developer can use the interfaces defined in this document
	to obtain timing data related to developer scripts.
    </p>
    <pre>
    &lt;!doctype html&gt;
    &lt;html&gt;
      &lt;head&gt;
        &lt;title&gt;User Timing example&lt;/title&gt;
      &lt;/head&gt;
      &lt;body onload="init()"&gt;
        &lt;script&gt;
           function init() 
           {
                performance.mark("startTask1");
                doTask1(); // Some developer code
                performance.mark("endTask1");
                
                performance.mark("startTask2");
                doTask2(); // Some developer code
                performance.mark("endTask2");

                measurePerf();
           }

           function measurePerf() 
           {
               var perfEntries = performance.getEntriesByType("mark");
               for (var i = 0; i &lt; perfEntries.length; i++)
               {
                     if (window.console) console.log("Name: "        + perfEntries[i].name      + 
                                                     " Entry Type: " + perfEntries[i].entryType +
                                                     " Start Time: " + perfEntries[i].startTime + 
                                                     " Duration: "   + perfEntries[i].duration  + "\n");
               }
           }
        &lt;/script&gt;
      &lt;/body&gt;
    &lt;/html&gt;
    </pre>
    </div>

    <h2 id="conformance-requirements"><span class="secno">2 </span>Conformance
    requirements</h2>

    <p>All diagrams, examples, and notes in this specification are non-normative,
    as are all sections explicitly marked non-normative. Everything else in this
    specification is normative. </p>

    <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT",
    "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this document
    are to be interpreted as described in RFC2119. For readability, these words
    do not appear in all uppercase letters in this specification. <a
    href="#rfc2119">[RFC2119]</a>
    </p>

    <p>Requirements phrased in the imperative as part of algorithms (such as
    "strip any leading space characters" or "return false and abort these steps")
    are to be interpreted with the meaning of the key word ("must", "should",
    "may", etc) used in introducing the algorithm. </p>

    <p>Some conformance requirements are phrased as requirements on attributes,
    methods or objects. Such requirements are to be interpreted as requirements
    on user agents. </p>

    <p>Conformance requirements phrased as algorithms or specific steps may be
    implemented in any manner, so long as the end result is equivalent. (In
    particular, the algorithms defined in this specification are intended to be
    easy to follow, and not intended to be performant.) </p>

    <p>The IDL fragments in this specification must be interpreted as
    required for conforming IDL fragments, as described in the Web IDL
    specification. <a href="#WebIDL">[Web IDL]</a></p>

    <h2 id="terminology"><span class="secno">3 </span>Terminology</h2>

    <p>The construction "a <code title="">Foo</code> object", where <code
    title="">Foo</code> is actually an interface, is sometimes used instead of
    the more accurate "an object implementing the interface <code
    title="">Foo</code>". </p>

    <p>The term "JavaScript" is used to refer to ECMAScript <a
    href="#ECMA262">[ECMA262]</a>, rather than the
    official term ECMAScript, since the term JavaScript is more widely known. 
    </p>

    <p>
      Throughout this work, all time values are measured in milliseconds since the start of 
      navigation of the document. For example, the start of navigation of the document 
      occurs at time 0. The term <i>current time</i> refers to the number of milliseconds 
      since the start of navigation of the document until the current moment in time. 
      This definition of time is based on the High Resolution Time specification
      [<a href="http://www.w3.org/TR/hr-time/">High Resolution Time</a>] and is different
      from the definition of time used in the Navigation Timing specification 
      [<a href="http://www.w3.org/TR/navigation-timing/">Navigation Timing</a>],
      where time is measured in milliseconds since midnight of January 1, 1970 (UTC).
    </p>

    <h2 id="user-timing-0"><span class="secno">4 </span>User Timing</h2>

    <h3 id="introduction-1"><span class="secno">4.1 </span>Introduction</h3>

    <p>This section is non-normative</p>

    <p>The <a href="#performancemark"><code>PerformanceMark</code></a> and 
	<a href="#performancemeasure"><code>PerformanceMeasure</code></a> interfaces, and extensions to the
	<a href="#extensions-performance-interface"><code>Performance</code></a> interface,	give web developers access to a high precision, monotonically 
       increasing timestamp so they can better measure the performance characteristics of their
       applications.</p>

    <h3 id="extensions-performance-interface"><span class="secno">4.2</span> Extensions to the <code>Performance</code> Interface</h3>

    <pre class="idl">
  partial interface <a id='performance' href="http://www.w3.org/TR/navigation-timing/#performance">Performance</a> {
    void <a href="#dom-performance-mark">mark</a>(<a class="noxref" href="http://www.w3.org/TR/WebIDL/#idl-DOMString">DOMString</a> markName);
    void <a href="#dom-performance-clearmarks">clearMarks</a>(optional  <a class="noxref" href="http://www.w3.org/TR/WebIDL/#idl-DOMString">DOMString</a> markName);

    void <a href="#dom-performance-measure">measure</a>(<a class="noxref" href="http://www.w3.org/TR/WebIDL/#idl-DOMString">DOMString</a> measureName, optional <a class="noxref" href="http://www.w3.org/TR/WebIDL/#idl-DOMString">DOMString</a> startMark, optional <a class="noxref" href="http://www.w3.org/TR/WebIDL/#idl-DOMString">DOMString</a> endMark);
    void <a href="#dom-performance-clearmeasures">clearMeasures</a>(optional <a class="noxref" href="http://www.w3.org/TR/WebIDL/#idl-DOMString">DOMString</a> measureName);
  };
    </pre>
    <div class="methods">
    <h4 id="dom-performance-mark"><code>mark</code> method</h4>
    <p>This method stores a timestamp with the associated name (a "mark").</p>
    <div class="parameters">
        <p><b>Parameters</b></p>
        <p>in <code>markName</code> type of <a href="http://www.w3.org/TR/WebIDL/#idl-DOMString"><code>DOMString</code></a></p>
        <div class="parameterDefinition">
            <p>The name associated with the timestamp.</p>
            <p>Mark names may be re-used within the same document.
            Each call to the <code>mark()</code> method stores a new timestamp 
            under the specified mark name.</p>
            <p>The mark name cannot be the same name as any of the attributes in the 
            <code><a href="http://www.w3.org/TR/navigation-timing/#performancetiming">PerformanceTiming</a></code> interface <a href="#NavigationTiming">[Navigation Timing]</a>.</p>

            <p id="ut-standard-mark-names"><b>Recommended Mark Names</b></p>
            <p>Developers are encouraged to use the following Recommended Mark Names to mark common interactions. The user agent is responsible for storing 
                a new timestamp under the specified mark name for Recommended Mark Names, just like any user specified mark name.
                The user agent does not validate that the usage of the Recommended Mark Name is appropriate or consistent with its description.</p>
            <code id="dom-performance-mark-fully-loaded">"mark_fully_loaded"</code>
            <div class="parameterDefinition">
                <p>The time when the page is considered fully loaded as marked by the developer in their application.</p>
            </div>

            <code id="dom-performance-mark-fully-visible">"mark_fully_visible"</code>
            <div class="parameterDefinition">
                <p>The time when the page is considered completely visible to an end-user as marked by the developer in
                their application.</p>
            </div>

            <code id="dom-performance-mark-above-the-fold">"mark_above_the_fold"</code>
            <div class="parameterDefinition">
                <p>The time when all of the content in the visible viewport has been presented to the end-user as marked by
                the developer in their application.</p>
            </div>

            <code id="dom-performance-mark-time-to-user-action">"mark_time_to_user_action"</code>
            <div class="parameterDefinition">
                <p>The time of the first user interaction with the page during or after a navigation, such as scroll or click,
                as marked by the developer in their application.</p>
            </div>
        </div>

        <p><b>No Return Value</b></p>

        <p><b>Exceptions</b></p>
        <p>Throws a <code>SYNTAX_ERR</code> exception if the <em>markName</em> argument is the same name as an attribute in the 
        <code><a href="http://www.w3.org/TR/navigation-timing/#performancetiming">PerformanceTiming</a></code> interface.</p>
    </div>
  </div>

  <div class="methods">
    <h4 id="dom-performance-clearmarks"><code>clearMarks</code> method</h4>
    <p>If the <em>markName</em> argument is not specified, this method removes all marks and their associated <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> time values.</p>
    <p>If the <em>markName</em> argument is specified, this method removes all <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> time values for the given mark name.</p>
    <p>If the <em>markName</em> argument is specified but the specified <em>markName</em> does not exist, this method will do nothing.</p>
    <div class="parameters">
        <p><b>Parameters</b></p>
        <p>in <code>markName</code> type of <a href="http://www.w3.org/TR/WebIDL/#idl-DOMString"><code>DOMString</code></a></p>
        <div class="parameterDefinition">
            <p>[optional] The name of the mark whose <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> time values should be cleared.  
			If not specified, all marks will be cleared.</p>
        </div>

        <p><b>No Return Value</b></p>

        <p><b>No Exceptions</b></p>
    </div>
  </div>

  <div class="methods">
    <h4 id="dom-performance-measure"><code>measure</code> method</h4>
    <p>This method stores the <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> duration between two marks 
	along with the associated name (a "measure").</p>
    <p>The behavior of this method depends on which arguments are specified:</p>
    <ul>
        <li>If neither the <em>startMark</em> nor the <em>endMark </em>argument is specified,
            <code>measure()</code> will store the duration as a <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> from 
            <a href="http://www.w3.org/TR/navigation-timing/#dom-performancetiming-navigationstart">navigationStart</a>
            to the current time.</li>
        <li>If the <em>startMark</em> argument is specified, but the <em>endMark </em>argument is not specified,
            <code>measure()</code> will store the duration as a <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a>
             from the most recent occurrence of the start mark to the current time.</li>
        <li>If both the <em>startMark</em> and <em>endMark </em>arguments are specified, <code>measure()</code> will store the duration as a <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a>
             from the most recent occurrence of the start mark to the most recent occurrence of the end mark.</li>
    </ul>
    <p>The <em>startMark</em> and <em>endMark</em> arguments may be the name of one of the attributes in the
       <code><a href="http://www.w3.org/TR/navigation-timing/#performancetiming">PerformanceTiming</a></code> interface <a href="#NavigationTiming">[Navigation Timing]</a>. 
       In this case, the value of that attribute is used as the <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> time value.</p>
    <div class="parameters">
        <p><b>Parameters</b></p>
        <p>in <code>name</code> type of <a href="http://www.w3.org/TR/WebIDL/#idl-DOMString"><code>DOMString</code></a></p>
        <div class="parameterDefinition">
            <p>The name associated with the measure.</p>
            <p>Measure names may be re-used within the same document.
            Each call to the <code>measure()</code> method stores a new duration
            under the specified measure name.</p>
            <p>Measure names live independently from mark names.</p>
        </div>

        <p>in <code>startMark</code> type of <a href="http://www.w3.org/TR/WebIDL/#idl-DOMString"><code>DOMString</code></a></p>
        <div class="parameterDefinition">
            <p>[optional] The name of the start mark.</p>
            <p>If specified, the most recent <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> time value of the start mark is used.</p>
            <p>If not specified, <a href="http://www.w3.org/TR/navigation-timing/#dom-performancetiming-navigationstart">navigationStart</a> is used.</p>
            <p>May be the name of one of the attributes in the
               <code><a href="http://www.w3.org/TR/navigation-timing/#performancetiming">PerformanceTiming</a></code> interface <a href="#NavigationTiming">[Navigation Timing]</a>.
               In this case, the value of that attribute is used as the start <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> time value.</p>
        </div>

        <p>in <code>endMark</code> type of <a href="http://www.w3.org/TR/WebIDL/#idl-DOMString"><code>DOMString</code></a></p>
        <div class="parameterDefinition">
            <p>[optional] The name of the end mark.</p>
            <p>If specified, the most recent <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> time value of the end mark is used.</p>
            <p>If not specified, the current time as a <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> is used.</p>
            <p>May be the name of one of the attributes in the
               <code><a href="http://www.w3.org/TR/navigation-timing/#performancetiming">PerformanceTiming</a></code> interface <a href="#NavigationTiming">[Navigation Timing]</a>.
               In this case, the value of that attribute is used as the end <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> time value.</p>
        </div>

        <p><b>No Return Value</b></p>

        <p><b>Exceptions</b></p>
        <p>Throws a <code>SYNTAX_ERR</code> exception if the start mark or end mark does not exist.</p>
		<p>Throws an <code>INVALID_ACCESS_ERR</code> exception if either <code>startMark</code> or <code>endMark</code> argument, or both, have the same name as a
		   <code><a href="http://www.w3.org/TR/navigation-timing/#performancetiming">PerformanceTiming</a></code> attribute with a time value of 0.</p>
    </div>
  </div>

  <div class="methods">
    <h4 id="dom-performance-clearmeasures"><code>clearMeasures</code> method</h4>
    <p>If the <em>measureName</em> argument is not specified, this method removes all measures and their associated <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> durations.</p>
    <p>If the <em>measureName</em> argument is specified, this method removes all <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> durations for the given measure name.</p>
    <p>If the <em>measureName</em> argument is specified but the specified <em>measureName</em> does not exist, this method will do nothing.</p>
    <div class="parameters">
        <p><b>Parameters</b></p>
        <p>in <code>measureName</code> type of <a href="http://www.w3.org/TR/WebIDL/#idl-DOMString"><code>DOMString</code></a></p>
        <div class="parameterDefinition">
            <p>[optional] The name of the measure whose <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a> durations should be cleared.  
			If not specified, all measures will be cleared.</p>
        </div>

        <p><b>No Return Value</b></p>

        <p><b>No Exceptions</b></p>
    </div>
  </div>

    <h3 id="performancemark"><span class="secno">4.3</span> The <code>PerformanceMark</code> Interface</h3>

    <pre class="idl">
  interface PerformanceMark : <a href="http://www.w3.org/TR/performance-timeline/#performanceentry">PerformanceEntry</a> {
  };
    </pre>

    <p>
    	The <a href="#performancemark">PerformanceMark</a> interface also 
		exposes marks created via the <code><a href="#dom-performance-mark">mark()</a></code> 
		method to the 
    	<a href="http://www.w3.org/TR/performance-timeline/#sec-performance-timeline">Performance Timeline</a> <a href="#PerformanceTimeline">[Performance Timeline]</a>. The <a href="#performancemark">PerformanceMark</a> 
		interface extends the following attributes of the <a href="http://www.w3.org/TR/performance-timeline/#performanceentry">PerformanceEntry</a>
		interface:
    </p>
    
    <div class="parameters">
        <p>The <code>name</code> attribute will return the mark's name.</p>
        <p>The <code>entryType</code> attribute will return the <a href='http://www.w3.org/TR/WebIDL/#idl-DOMString'><code>DOMString</code></a> <code>mark</code>.</p>
        <p>The <code>startTime</code> attribute will return a <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a>
		with the mark's time value <a href='#HighResolutionTime'>[High Resolution Time]</a>.
    	</p>
        <p>The <code>duration</code> attribute will return a <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a>
		of value 0.</p>
    </div>

    <h3 id="performancemeasure"><span class="secno">4.4</span> The <code>PerformanceMeasure</code> Interface</h3>

    <pre class="idl">
  interface PerformanceMeasure : <a href="http://www.w3.org/TR/performance-timeline/#performanceentry">PerformanceEntry</a> {
  };
    </pre>
    
	<p>
    	The <a href="#performancemeasure">PerformanceMeasure</a> interface also 
		exposes measures created via the <code><a href="#dom-performance-measure">measure()</a></code> 
		method to the <a href="http://www.w3.org/TR/performance-timeline/#sec-performance-timeline">Performance Timeline</a> <a href="#PerformanceTimeline">[Performance Timeline]</a>. The <a href="#performancemeasure">PerformanceMeasure</a> interface extends the following attributes of the <a href="http://www.w3.org/TR/performance-timeline/#performanceentry">PerformanceEntry</a> interface:
    </p>
	
    <div class="parameters">
        <p>The <code>name</code> attribute will return the measure's name.</p>
        <p>The <code>entryType</code> attribute will return the <a href='http://www.w3.org/TR/WebIDL/#idl-DOMString'><code>DOMString</code></a> <code>measure</code>.</p>
        <p>The <code>startTime</code> attribute will return a <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a>
		with the measure's start mark <a href='#HighResolutionTime'>[High Resolution Time]</a>.</p>
        <p>The <code>duration</code> attribute will return a <a href="http://www.w3.org/TR/hr-time/#domhighrestimestamp"><code>DOMHighResTimeStamp</code></a>
		with the duration of the measure. </p>
    </div>

    <h3 id="vendor-prefixes">4.5 Vendor Prefixes</h3>

    <p>Vendor-specific proprietary user agent extensions are discouraged. 
    If such extensions are needed, e.g. for experimental purposes, vendors must use the following extension mechanisms:</p>

    <p>If the extension to be added is a <a href="#ut-standard-mark-names">Standard Mark Name</a>, the Standard Mark Name must:</p>
    <ul>
        <li>Follow this naming convention: [VENDORPREFIX]_[STANDARD_MARK_NAME], where [VENDORPREFIX] is a name that identifies the vendor and [STANDARD_MARK_NAME] is the name given to the Standard Mark.</li>
    </ul>


    <h2 id="monotonic-clock"><span class="secno">5 </span>Monotonic Clock</h2>
    <p>The time values stored within the interface <span class='rfc2119'>must</span> monotonically increase to ensure they are not 
    affected by adjustments to the system clock. The difference between any two chronologically 
    recorded time values <span class='rfc2119'>must</span> never be negative. The user agent <span class='rfc2119'>must</span> record the system clock at the beginning 
    of the navigation and define subsequent time values in terms of a monotonic clock measuring time elapsed 
    from the beginning of the navigation.
    </p>
	
	<h2 id="privacy-security"><span class="secno">6 </span>Privacy and Security</h2>

	<p>This section is non-normative.</p>

	<p>The interfaces defined in this specification	expose potentially sensitive timing information on specific JavaScript activity of a page. 
	However, unlike other interfaces defined in the <a href="http://www.w3.org/TR/performance-timeline/#sec-performance-timeline">Performance Timeline</a>,
	the interfaces defined in this specification do not have any restrictions on sharing timing information through script. This is because the web platform has been designed with the invariant that 
	any script included on a page has the same access as any other script included on that page regardless of the origin of the script. </p>

    <h2 class="no-num" id="acknowledgements">Acknowledgements</h2>

    <p>Thanks to Karen Anderson, Tony Gentilcore, Nic Jansma, James Simonsen, Steve Souders, Sigbjorn Vik, and Jason Weber for their useful comments that led to changes to this specification and their contributions to this work.</p>

<h2 class="no-num" id="references">References</h2>

<dl>
<dt><a id='rfc2119'>[IETF RFC 2119]</a></dt>
<dd>
 <cite><a href='http://www.ietf.org/rfc/rfc2119.txt'>Key words for use in RFCs to Indicate Requirement Levels</a></cite>, Scott Bradner, Author. Internet Engineering Task Force, March 1997. Available at <a href='http://www.ietf.org/rfc/rfc2119.txt'>http://www.ietf.org/rfc/rfc2119.txt</a>. 
</dd>
    <dt>[<a id="ECMA262">ECMA-262</a>]</dt>
    <dd>
     <cite><a href='http://www.ecma-international.org/publications/standards/Ecma-262.htm'>ECMAScript Language Specification</a></cite>, 5.1
     Edition. ECMA International, Standard
     ECMA-262, June 2011. This version of the ECMAScript
     Language is available from http://www.ecma-international.org/publications/standards/Ecma-262.htm.
    </dd>

   <dt>[<a id="NavigationTiming">Navigation Timing</a>]</dt>
   <dd><cite><a href='http://www.w3.org/TR/2012/PR-navigation-timing-20120726/'>Navigation Timing</a></cite>, Zhiheng Wang, Editor. World Wide Web Consortium, July 2012. This version of the Navigation Timing specification is available from http://www.w3.org/TR/2012/PR-navigation-timing-20120726/. The <a href='http://www.w3.org/TR/navigation-timing/'>latest version of Navigation Timing</a> is available at http://www.w3.org/TR/navigation-timing/.</dd>

   <dt>[<a id="PerformanceTimeline">Performance Timeline</a>]</dt>
   <dd><cite><a href='http://www.w3.org/TR/2012/CR-performance-timeline-20120726/'>Performance Timeline</a></cite>, Jatinder Mann, et al, Editors. World Wide Web Consortium, July 2012. This version of the Performance Timeline specification is available from http://www.w3.org/TR/2012/WD-performance-timeline-20120726/. The <a href='http://www.w3.org/TR/performance-timeline/'>latest version of Performance Timeline</a> is available at http://www.w3.org/TR/performance-timeline/.</dd>
   
   <dt>[<a id="HighResolutionTime">High Resolution Time</a>]</dt>
   <dd><cite><a href='http://www.w3.org/TR/2012/CR-hr-time-20120522/'>High Resolution Time</a></cite>, Jatinder Mann, Editor. World Wide Web Consortium, May 2012. This version of the High Resolution Time specification is available from http://www.w3.org/TR/2012/CR-hr-time-20120522/. The <a href='http://www.w3.org/TR/hr-time/'>latest version of High Resolution Time</a> is available at http://www.w3.org/TR/hr-time/.</dd>

   <dt>[<a id="WebIDL">Web IDL</a>]</dt>
   <dd><cite><a href='http://www.w3.org/TR/2012/CR-WebIDL-20120419/'>Web IDL</a></cite>, Cameron McCormack, Editor. World Wide Web Consortium, April 2012. This version of the Web IDL specification is available from http://www.w3.org/TR/2012/CR-WebIDL-20120419/. The <a href='http://www.w3.org/TR/WebIDL/'>latest version of Web IDL</a> is available at http://www.w3.org/TR/WebIDL/.</dd>

</dl>

</div>
</body>

</html>
